'''
Created on 2012-4-23

@author: nzhao
'''
import numpy as np
import materials as ma

class Spin():
    '''
    class of a single spin
    '''


    def __init__(self, spintype='E', pos=np.array([0.0, 0.0, 0.0]), state=np.array([1.0, 0.0])):
        '''
        constructor of a single spin
        '''
        self.spinType     = spintype
        self.spinValue    = ma.SpinDictionary[spintype]['SpinValue']
        self.spinGamma    = ma.SpinDictionary[spintype]['GyromagneticRatio']
        self.spinRelGamma = ma.SpinDictionary[spintype]['RelativeGyromagneticRatio']
        self.spinPosition = pos
        self.spinState    = state
        
    def show(self):
        return [self.spinType, self.spinPosition]

if __name__ == '__main__':
    s1=Spin()
    print s1.spinType, s1.spinValue, s1.spinGamma, s1.spinPosition
    